<?php
/**
 * userLoginDao
 */

class Dao_UserRechargeModel extends Dao_BaseModel {

    protected $_table = 'recharge';

    const NORMAL_STATUS = 1;
    const REDIS_KEYWORD = 'USER_SET_KEY_';
    const EXTIME        = '86400';

    public function __construct ()
    {
        parent::__construct ();
    }
    
    /**
     * 获取用户充值记录
     */
    public function getUserRecharge( $uid )
    {
        if( !$uid ){
            return [];
        }
        $where   = [];
        $where[] = [ 'user_id' , $uid ];
        $order   = [ 'pay_time' => 'desc' ];
        $info = parent::getRows( array ( '*' ) , $where ,$order );
        return $info;
    }
    
    /**
     * 新增记录
     */
    public function addRecharge($data)
    {
        $info = parent::add ( $data );
        return $info;
    }
    
}
